import Vue from 'vue';
const prefix = '/api/user/';

/**
 * 用户注册
 * request: {
 *  email: "",    // 用户邮箱
 *  username: "", // 用户名称
 *  password: ""  // 用户密码
 * }
 */
export const userRegister = (data) => {
  return Vue.$http({
    url: prefix + 'register/v2',
    method: 'post',
    data: {
      email: data.email,
      username: data.username,
      password: data.password,
      verifyCode: data.captcha
    }
  });
};

export const userGetCap = (emailName) => {
  return Vue.$http({
    url: prefix + 'verifyEmail',
    method: 'post',
    data: {
      email: emailName
    }
  });
};
